<?php
Yii::import('application.components.AjaxModel');
Yii::import('application.components.auctionCache.AuctionCacheData');
Yii::import('application.components.auctionCache.AuctionDataAjax');
class ShelfDataAjax extends AuctionDataAjax{
    public $ver;
    protected $_auctionIds;
    
    public function rules(){
        return array(
            array('ids,ver','safe')
        );
    }
    
    public function setIds($auctionIds){
        $tempAuctionIds = explode('|', $auctionIds);
        return $this->_auctionIds = $tempAuctionIds;
    }
    
    public function getIds(){
        return $this->_auctionIds;
    }
    
    public function run(){    
        $auctionData = new AuctionCacheData();
        $rData = $auctionData->findModifyAllByPkGNC($this->_auctionIds,$this->ver);
        $this->setResponse('rData', Yii::app()->tools->modelsToArray($rData,array('id','status','end_time','winner_price','winner_id')));
        $this->setResponse('t',time());
        $this->setResponse('ver', time());
        return $this;
    }
}
